import heapq

n, m = map(int, input().split())
sticks = list(map(lambda x: -int(x), input().split()))
heapq.heapify(sticks)
for _ in range(m):
    t = heapq.heappop(sticks)
    heapq.heappush(sticks, t // 2)
    heapq.heappush(sticks, t - t // 2)
print(-sticks[0])
